package demo4;
class MessageInfo<T>{
    T message;
    public T getMessage() {
        return message;
    }
    public void setMessage(T message) {
        this.message = message;
    }

}
public class Test {
    public static void main(String[] args) {
        MessageInfo<String> messageInf=new MessageInfo<>();
        messageInf.setMessage("hello world");
        printMessageInfo(messageInf);
    }
    public static void printMessageInfo(MessageInfo<?> messageInfo){
        System.out.println(messageInfo.getMessage());
    }
}
